/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csgui.entities;

import csgui.PacketSchedulerEnum;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author robert
 */
@Entity
public class GridSimEntity implements Serializable {
    protected static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    protected Long id;
    @Basic protected PacketSchedulerEnum packetSchedulerEnum;
    @Basic protected String name;
    @Basic protected Double baudRate; 
    @Basic protected Double propagationDelay;
    @Basic protected Integer mtu;
    @ManyToOne protected Router router;
    @ManyToOne protected Experiment experiment;

    public GridSimEntity()
    {
    }

    public PacketSchedulerEnum getPacketSchedulerEnum() {
        return packetSchedulerEnum;
    }

    public void setPacketSchedulerEnum(PacketSchedulerEnum packetSchedulerEnum) {
        this.packetSchedulerEnum = packetSchedulerEnum;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getBaudRate() {
        return baudRate;
    }

    public void setBaudRate(Double baudRate) {
        this.baudRate = baudRate;
    }

    public Double getPropagationDelay() {
        return propagationDelay;
    }

    public void setPropagationDelay(Double propagationDelay) {
        this.propagationDelay = propagationDelay;
    }

    public Integer getMtu() {
        return mtu;
    }

    public void setMtu(Integer mtu) {
        this.mtu = mtu;
    }

    public Router getRouter() {
        return router;
    }

    public void setRouter(Router router) {
        this.router = router;
    }

    public Experiment getExperiment() {
        return experiment;
    }

    public void setExperiment(Experiment experiment) {
        this.experiment = experiment;
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GridSimEntity)) {
            return false;
        }
        GridSimEntity other = (GridSimEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "csgui.entities.GridSim[ id=" + id + " ]";
    }
    
}
